package com.szit.adminclient.feign;

import com.szit.adminclient.feign.fallback.AdminFeignFallbackFactory;
import com.szit.util.Result;
import com.szit.util.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "admin-server",fallback = AdminFeignFallbackFactory.class)
public interface AdminFeign {

    @PostMapping("login")
    @ResponseBody
    Result login(@RequestBody LoginUser loginUser);

    @PostMapping("loginOut")
    @ResponseBody
    Result loginOut(String token);

    @PostMapping("updatePasswordByUsername")
    @ResponseBody
    Result updatePasswordByUsername(@RequestBody ModifyPasswordInfo modifyPasswordInfo);

    @PostMapping("insertAdminUser")
    @ResponseBody
    Result insertAdminUser(@RequestBody AdminUserInfo adminUserInfo);

    @PostMapping("deleteAdminUserByUserId")
    @ResponseBody
    Result deleteAdminUserByUserId(@RequestParam String token, @RequestParam Integer userId);

    @PostMapping("selectAllUser")
    @ResponseBody
    Result selectAllUser(@RequestParam String token, @RequestParam Integer pageNum, @RequestParam Integer pageSize);

    @PostMapping("insertAdminPermission")
    @ResponseBody
    Result insertAdminPermission(@RequestBody AdminPermissionInfo adminPermissionInfo);

    @PostMapping("deletePermissionById")
    @ResponseBody
    Result deletePermissionById(@RequestParam String token, @RequestParam Integer permissionId);

    @PostMapping("updatePermissionById")
    @ResponseBody
    Result updatePermissionById(@RequestBody AdminPermissionInfo adminPermissionInfo);

    @PostMapping("selectAllPermission")
    @ResponseBody
    Result selectAllPermission(@RequestParam String token, @RequestParam Integer pageNum, @RequestParam Integer pageSize);

    @PostMapping("insertAdminRole")
    @ResponseBody
    Result insertAdminRole(@RequestBody AdminRoleInfo adminRoleInfo);

    @PostMapping("deleteRoleById")
    @ResponseBody
    Result deleteRoleById(@RequestParam String token, @RequestParam Integer roleId);

    @PostMapping("updateRoleById")
    @ResponseBody
    Result updateRoleById(@RequestBody AdminRoleInfo adminRoleInfo);

    @PostMapping("selectAllAdminRole")
    @ResponseBody
    Result selectAllAdminRole(@RequestParam String token, @RequestParam Integer pageNum, @RequestParam Integer pageSize);

    @PostMapping("updateUserRoleByUserId")
    @ResponseBody
    Result updateUserRoleByUserId(@RequestBody AdminUserRoleInfo adminUserRoleInfo);

    @PostMapping("deleteAdminUserRole")
    @ResponseBody
    Result deleteAdminUserRole(@RequestBody AdminUserRoleInfo adminUserRoleInfo);

    @PostMapping("updateRolePermissionByRoleId")
    @ResponseBody
    Result updateRolePermissionByRoleId(@RequestBody AdminRolePermissionInfo adminRolePermissionInfo);

    @PostMapping("deleteAdminRolePermission")
    @ResponseBody
    Result deleteAdminRolePermission(@RequestBody AdminRolePermissionInfo adminRolePermissionInfo);
}
